function collect_same_elements(collection_a, object_b) {
  //在这里写入代码
  let arr = [] ;
  for(let item1 of collection_a){
    for(let item2 of object_b.value){
      if(item1.key === item2){
        arr.push(item1.key) ;
      }
    }
  }
  return arr;
}

module.exports = collect_same_elements;
// var collection_a = [
//   {key: "a"}, {key: "e"}, {key: "h"}, {key: "t"}, {key: "f"}, {key: "c"}, {key: "g"}, {key: "b"}, {key: "d"}
// ];
// var collection_b = {value: ["a", "d", "e", "f"]};
// console.log(collect_same_elements(collection_a,collection_b))